/**
 * 
 */
package com.tomkid.naojin.acts;

import com.tomkid.naojin.utils.CConstance;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;

/**
 * 5485 jokes
 * 
 * @author zhao.tb
 */
public class ListMainActivity extends BaseActivity {
	private Button mBtn_LastShow = null;
	private ListView mLV_ListTitles = null;
	private String[] mArrayQuestions = null;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.list_main);
		mBtn_LastShow = (Button) findViewById(R.id.btn_LastShow);
		mLV_ListTitles = (ListView) findViewById(R.id.lv_listQuestions);
		mArrayQuestions = getResources().getStringArray(R.array.array_Questions);
		
		mLV_ListTitles.setAdapter(new ArrayAdapter<String>(ListMainActivity.this, R.layout.list_item, R.id.list_item, mArrayQuestions));
		mLV_ListTitles.setOnItemClickListener(new ListView.OnItemClickListener() {
			@Override
			public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
				Intent i = new Intent(ListMainActivity.this, DetailsOneActivity.class);
				i.putExtra("no", arg2);
				if(null != getParent()){
					((MainTabsActivity)getParent()).startActivity(i,true);
				}
			}
		});
		
	}
}
